#include<bits/stdc++.h>
using namespace std;
int vis[100010],u[100010],v[100010],n,m,k,fa[20][100010],a[100010],ans1[100010],ans2[100010],cnt,sum,dep[100010],mp[100010],b[100010],xxx;
vector<int>e[100010];
//map<int,int>mmp;
int dfs(int x){
//	cout<<x<<"\n";
	vis[x]=1;
	stack<int>sta;
	if(mp[x]==1)sta.push(x);
	for(int i=0;i<e[x].size();i++){
		if(vis[e[x][i]]==0){
			u[++cnt]=x,v[cnt]=e[x][i];
			int tmp=dfs(e[x][i]);
			if(tmp!=0)sta.push(tmp);
		}
	}
//	cout<<x<<" "<<sta.size()<<"\n";
	while(sta.size()>=2){
		ans1[++sum]=sta.top();
		sta.pop();
		ans2[sum]=sta.top();
		sta.pop();
//		if(mmp[ans1[sum]]>=1)cout<<ans1[sum]<<" ";
//		if(mmp[ans2[sum]]>=1)cout<<ans2[sum]<<" ";
//		mmp[ans1[sum]]++,mmp[ans2[sum]]++;
	}
	if(!sta.empty())return sta.top();
	else return 0;
}
void dfs2(int x,int f){
	fa[0][x]=f,dep[x]=dep[f]+1,vis[x]=1;
	for(int i=0;i<e[x].size();i++){
		if(vis[e[x][i]]==0){
			dfs2(e[x][i],x);
		}
	}
}
int LCA(int x,int y){
//	if(xxx==1)cout<<x<<" "<<y<<"\n";
	if(dep[x]<dep[y])swap(x,y);
//	if(xxx==1)cout<<x<<" "<<y<<"\n";
	for(int i=18;i>=0;i--)if(dep[fa[i][x]]>=dep[y])x=fa[i][x];
//	if(xxx==1)cout<<x<<" "<<y<<"\n";
	for(int i=18;i>=0;i--)if(fa[i][x]!=fa[i][y])x=fa[i][x],y=fa[i][y];
//	if(xxx==1)cout<<x<<" "<<y<<"\n";
	if(x!=y)return fa[0][x];
	else return x;
}
int main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); 
	freopen("travel.in","r",stdin);
	freopen("travel.out","w",stdout);
	cin>>n>>m>>k;
	for(int i=1;i<=m;i++){
		int U,V;
		cin>>U>>V;
		e[U].push_back(V);
		e[V].push_back(U);
	}
	for(int i=1;i<=k;i++)cin>>a[i],mp[a[i]]=1;
	for(int i=1;i<=n;i++){
		if(vis[i]==0){
			int tmp=dfs(i);
		}
	}
	for(int i=1;i<=n;i++)vis[i]=0,e[i].clear();
	for(int i=1;i<=cnt;i++){
		e[u[i]].push_back(v[i]);
		e[v[i]].push_back(u[i]);
	}
	for(int i=1;i<=n;i++){
		if(vis[i]==0){
			dfs2(i,0);
		}
	}
	for(int i=1;i<=18;i++)for(int j=1;j<=n;j++)fa[i][j]=fa[i-1][fa[i-1][j]];
	cout<<sum<<"\n";
	for(int i=1;i<=sum;i++){
//		cout<<ans1[i]<<" "<<ans2[i]<<"\n";
		int lca=LCA(ans1[i],ans2[i]),tmp=ans1[i],resa=0,resb=0;
		while(tmp!=lca)a[++resa]=tmp,tmp=fa[0][tmp];
		tmp=ans2[i];
		while(tmp!=lca)b[++resb]=tmp,tmp=fa[0][tmp];
//		if(resa+resb+1==15){
//			xxx=1;
//			lca=LCA(ans1[i],ans2[i]);
//			cout<<ans1[i]<<" "<<ans2[i]<<" "<<lca<<"\n";
			cout<<resa+resb+1<<" ";
			for(int j=1;j<=resa;j++)cout<<a[j]<<" ";
			cout<<lca<<" ";
			for(int j=resb;j>=1;j--)cout<<b[j]<<" ";
			cout<<"\n";
//			xxx=0;
//		}
	}
	return 0;
}
